/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.*;
import bean.Product;
import dao.ProductDao;

/**
 *
 * @author root
 */
@Service
public class ProductService {

    @Autowired
    private ProductDao dao;

    /**
       * 分页取得产品信息
      * @param protype 产品类别
      * @param pagesize 每页数量
      * @param page 页数
      * @return 
     */
    public List<Product> getListPagingProductByProTypePage(int protype, int pagesize, int page) {
        return dao.getListPagingProductByProTypePage(protype, pagesize, page);
    }

    /**
     * 得到全部产品展示数据
     * @return 
     */
    public List<Product> getListAllProduct() {
        return dao.getListAllProduct();
    }
    
    /**
     * 刷新取得产品信息
     * @param protype
     * @param begin
     * @param readsize
     * @return 
     */
     public List<Product> getListProductByProTypeRefresh(int protype,int begin,int readsize){
         return dao.getListProductByProTypeRefresh(protype, begin, readsize);
     }
}
